<template>
  <div id="drawProcessDesign">
    <a-button @click="getData">提交</a-button>
    <newDrawFlow
      :FlowConfig="FlowConfig"
    ></newDrawFlow>
  </div>
</template>

<script>
import newDrawFlow from '@/components/newDrawFlow/newDrawFlow'
export default {
  name: "Home",
  components: {newDrawFlow},
  data() {
    return {
      FlowConfig: [{"id":"root","groupId":null,"type":"1","title":"所有人","content":"请选择","isRow":true,"isRoot":true,"data":{}},{"title":"title","data":{},"id":"adhus6ljewzvgzko","groupId":"axug7862arjw5abt","type":"3","content":"undefinedadhus6ljewzvgzko","groupPid":"root","isRow":false},{"title":"title","data":{},"id":"a0nqd38eqhm5zzsb","groupId":"axug7862arjw5abt","type":"3","content":"undefineda0nqd38eqhm5zzsb","groupPid":"root","isRow":false},{"nodeId":undefined,"type":"2","childNode":undefined,"title":"title","content":"contenta2agnfu587zxao2u","conditionNodes":undefined,"groupId":"adhus6ljewzvgzko","id":"a2agnfu587zxao2u","isRow":true,"data":{}}]
    };
  },
  created() {
    // this.init();
  },
  methods: {
    getData() {
      console.log(this.$refs.flow);
      let res = this.$refs.flow.getResData();
      console.log("这是返回的一维数组", res);
    },
    /**
     * 1、创建一个row length 1
     * 2、创建一个col节点
     * 3、创建一组col length 1
     * return [{pid id type}]
     */
    getNodeArr() {
      this.FlowConfig = this.$refs.flow.getNodeArr();
      return this.FlowConfig;
    },
    init() {
      // this.FlowConfig = this.transform(this.FlowConfig);
    },
    clickNode(node) {
      console.log("当前点击节点", node);
    }
  }
};
</script>

<style lang="less" scoped>
#drawProcessDesign {
  background: #f0f2f5;
}
</style>
